<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./js/vue.js"></script>
</head>
<body>
    <div id="app">
        <div>{{str}}</div>
        <div>
            描述 <input  v-bind:value="str" @input="setValue"/>
        </div>
        <button @click="getValue">取值</button>
        <button @click="setValue">赋值</button>
    </div>
    
</body>
<script>
      new  Vue({
        el:"#app",
        data:{
            str:"字符串"
        },
        methods:{
            getValue(){
              alert(this.str);  
            },
            setValue(e){
                // console.log(window.event);
                // console.log(e);
                this.str = e.target.value;
            }
        }
      })

</script>
</html>